import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, CreateDateColumn } from 'typeorm';
import { CityEntity } from 'src/city/entities/city.entity';

@Entity('scenic_spot')
export class ScenicSpotEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ length: 100 })
  name: string;

  @Column({ length: 200 })
  address: string;

  @Column({ length: 200 })
  photoUrl: string;

  @ManyToOne(() => CityEntity, city => city.id)
  city: CityEntity;

  @CreateDateColumn()
  createdAt: Date;
}
